package cn.iocoder.yudao.module.trade.dal.mysql.orderverifycode;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.orderverifycode.OrderVerifyCodeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.orderverifycode.vo.*;

/**
 * 订单核销码 Mapper
 *
 * @author 万民匠心
 */
@Mapper
public interface OrderVerifyCodeMapper extends BaseMapperX<OrderVerifyCodeDO> {

    default PageResult<OrderVerifyCodeDO> selectPage(OrderVerifyCodePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderVerifyCodeDO>()
                .eqIfPresent(OrderVerifyCodeDO::getOrderId, reqVO.getOrderId())
//                .betweenIfPresent(OrderVerifyCodeDO::getDate, reqVO.getDate())
                .betweenIfPresent(OrderVerifyCodeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OrderVerifyCodeDO::getCode, reqVO.getCode())
                .orderByDesc(OrderVerifyCodeDO::getId));
    }

}